# ferreus_orbit Plugins for Dell "PowerEdge R420"|"PowerEdge R440"|"DSS1510"|"DSS 1510"

fo_get_sorted_name(){
	local id=$(fo_get_id)
  if [ "$USE_FO_NAME" -lt 1 ]; then
    echo sd$(fo_get_dev_letter ${id})
    exit 0
  else
    echo "Disk${id}"
    exit 0
  fi
}

fo_get_did(){
  fo_get_id $1
}

fo_get_id(){
	local host=$(echo $DEVPATH | cut -d/ -f6)
	case "${host}" in
	"usb2"|"1-1"|"2-1"|"2-8")
		local target=$(echo $DEVPATH | cut -d/ -f10)
		local id=$(echo "${target}"| cut -d: -f3)
		;;
	"host0"|"host3"|"host9"|"host10")
  	local target=$(echo $DEVPATH | cut -d/ -f8)
    local id=$(echo "${target}" | cut -d: -f3)
		;;
	*)
		logger -t "udev" "Device $DEVPATH detected but not supported"; exit 1
	;;
	esac
	echo $id
}

FO_DISPOSITION="Disposition unavailable"
